package com.hd.bean;

import java.io.Serializable;

import com.hd.until.*;
import com.eif.framework.common.utils.code.CommonRspCode;

/**
 * Created by morris on 05/01/2017.
 */
public class AnShuoIntResponse implements Serializable {

    private static final long serialVersionUID = -7356782549243119043L;

    private static final String SUCCESS_RESULT_CODE = "0000";
    private static final String FAILURE_RESULT_CODE = "1000";
    private static final String ERROR_RESULT_CODE = "9999";

    private AnShuoResponseTransHeader transHeader;

    public AnShuoResponseTransHeader getTransHeader() {
        if(transHeader != null && FAILURE_RESULT_CODE.equals(transHeader.getResultCode())){
            transHeader.setResultCode(CommonRspCode.FAILD.getCode());
        }
        return transHeader;
    }

    public void setTransHeader(AnShuoResponseTransHeader transHeader) {
        this.transHeader = transHeader;
    }

    public boolean isSuccess() {
        return transHeader != null && SUCCESS_RESULT_CODE.equals(transHeader.getResultCode());
    }
    
    public String toString() {
    	return LogFilterUtil.toFilteredString(this);
    }
}
